#! /bin/bash
export LANG=zh_CN.UTF-8
HIVE_HOME=/usr/bin/hive


${HIVE_HOME} -S -e "

create database if not exists edu_dws;
drop table if exists edu_dws.hkl_dws_check_wide_timecnt;
create table if not exists  edu_dws.hkl_dws_check_wide_timecnt(
	create_date			   string			comment '创建时间',
	dt                     string           comment '数据日期',
	class_id               int 			    comment '班级id',
	time_type			   string			comment '时间段标签，am 每天上午，pm 每天下午，nt 每天晚上',
	studying_cnt		   bigint  			comment '出勤人数',
	late_cnt			   bigint  			comment '迟到人数',
	leave_cnt			   bigint  			comment '请假人数'
)comment'考勤分析每天各时段人数统计表'
row format delimited fields terminated by '\t'
stored as orc tblproperties ('orc.compress'='SNAPPY');"